home *** CD-ROM | disk | FTP | other *** search
Wrap
/* ** $VER: Bleed 1.1, IE Arexx script ** Image Engineer Macro script ** © by Patrik M Nydensten ** 12/7 1996 Stockholm/Sweden ** ** Simulates TV color bleeding. */ Options results Signal on error /* Setup a place for errors to go */ if arg()==0 then exit ORIGINAL = arg(1) 'PROJECT_INFO' arg(1) 'WIDTH' /* Get width of image */ IW = RESULT 'PROJECT_INFO' arg(1) 'HEIGHT' /* Get height of image */ IH = RESULT 'REQUEST "Which color should bleed?" " Red | Green | Blue | All | Cancel "' if ((RC=5)|(RESULT=0)) then exit C = RESULT select when C = 1 then do ; BASE = RED ; XBASE = GREEN BLUE ; end when C = 2 then do ; BASE = GREEN ; XBASE = RED BLUE ; end when C = 3 then do ; BASE = BLUE ; XBASE = RED GREEN ; end when C = 4 then do ; end end /* select */ 'GET_NUMBER "Select Bleed amount." 1 100 " Go! " 8' if RC=5 then exit BLEED = RESULT /* Process */ if C = 4 then do BASE = RED ; XBASE = GREEN BLUE RedImage = bleedfeed(ORIGINAL) BASE = GREEN ; XBASE = RED BLUE GreenImage = bleedfeed(RedImage) 'CLOSE' RedImage BASE = BLUE ; XBASE = RED GREEN BlueImage = bleedfeed(GreenImage) 'CLOSE' GreenImage end else OutImage = bleedfeed(ORIGINAL) exit /* Procedures */ BleedFeed: parse arg INFEED 'BRIGHTNESS' INFEED '-255' XBASE Image = RESULT Image = bleedit(Image) 'BRIGHTNESS' INFEED '-255' BASE XImage = RESULT 'MARK' XImage 'PRIMARY' 'MARK' Image 'SECONDARY' 'COMPOSITE' '0 0 ADD' OutImage = RESULT 'CLOSE' Image 'CLOSE' XImage 'MARK' OutImage 'PRIMARY' return OutImage BleedIt: parse arg INIMAGE 'MARK' INIMAGE 'PRIMARY' 'MARK' INFEED 'ALPHA' 'DISPLACE' 16 trunc(BLEED/4) 'FAST' DisplacedImage = RESULT 'CONVOLVE' DisplacedImage '"IE:Convolves/GaussianBlur5x5"' NewImage = RESULT 'CLOSE' DisplacedImage 'MARK' NewImage 'PRIMARY' 'MARK' INIMAGE 'SECONDARY' 'COMPOSITE' '0 0 MAX' OutImage = RESULT 'CLOSE' NewImage 'CLOSE' INIMAGE return OutImage /*******************************************************************/ /* This is where control goes when an error code is returned by IE */ /* It puts up a message saying what happened and on which line */ /*******************************************************************/ error: if RC=5 then do /* Did the user just cancel us? */ IE_TO_FRONT LAST_ERROR 'REQUEST "'||RESULT||'"' exit end else do IE_TO_FRONT LAST_ERROR 'REQUEST "Error detected!!!'||D2C(10)||'Image Engineer error message is as follows'||D2C(10)||result||D2C(10)||'Script failed on line '||SIGL||'"' 'Doh!' exit end